<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //1. 参数默认值
        function ajax(url, method = "get", async = true) {
            console.log(url, method, async) ///aaa get true
        }
        ajax("/aaa", "get", true)
        ajax("/bbb")
        ajax("/ccc", "post")

        //2. rest参数 剩余参数
        function test(x, y, ...data) {
            console.log(x, y, data) //1 2 [3, 4, 5, 6]
        }
        test(1, 2, 3, 4, 5, 6)

        //3. name属性
        console.log(test.name) //test

    </script>
</body>

</html>